//P1480 A/B Problem:https://www.luogu.com.cn/problem/P1480

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

string a;
string ret;
int b;

int main()
{
	cin >> a >> b;
	int n = a.size();
	vector<int> v(n);
	for(int i = 0; i < n; i++)
	{
		v[i] = a[i] - '0';	
	}
	
	long long t = 0;
	for(int i = 0; i < n; i++)
	{
		t = t * 10 + v[i];
		int c = t / b;
		t = t % b;
		ret += c + '0';
	} 
	
	reverse(ret.begin(),ret.end());
	
	for(int i = n-1;i > 0; i--)
	{
		if(ret[i] == '0')
		{
			ret.pop_back();
		}
		else
			break;
	}
	reverse(ret.begin(),ret.end());
	
	cout << ret;
	
	return 0;
} 
